package example;

import ccore.CCore;
import ccore.CcorePackage;
import ccore.expression.CIntVar;
import ccore.model.CClass;

public class Main {
	
	public static void main(String[] args) {
		String file = "/LOCAL/Work/runtime-EclipseApplication/ccore/ex";
		
		CCore core = (CCore)utils.Utils.loadInstance(file, "ccore", CcorePackage.eINSTANCE).getContents().get(0);
		
		System.out.println("CCore name: " + core.getName());
		
		core.init();
		core.initClassId();
 		core.addGeneratedConstraints();
		core.initNodes();

 		core.initConstraintsVariables();
		core.initVariablesDependencies();
		
		for (CClass c: core.getCClasses()) {
			System.out.println("\n" + c.getCardinality());
			for (CIntVar v: c.getCardinality().getDependencies()) {
				System.out.println("> " + v);
			}
		}
		
		utils.Utils.saveInstance(file, "ccore", core, CcorePackage.eNS_URI, CcorePackage.eINSTANCE);
	}

}
